<template>
  <view class="">
    <scroll-view class="dialogue-box" :scroll-y="true"  :scroll-top="scrollTop" style="">
      <uni-table border stripe emptyText="暂无更多数据" >
      	<!-- 表头行 -->
      	<uni-tr>
          <uni-th width="100"  align="">状态</uni-th>
          <uni-th  width="100" align="">提现金额</uni-th>
      		<uni-th width="150" align="">提现时间</uni-th>
      	
      	</uni-tr>
      	<!-- 表格数据行 -->
      	<uni-tr v-for="(item) in jllist" :key="item.id">
          <uni-td ><span :style="{color: item.color}">{{item.status}}</span><br/><span :style="{color: item.color}">{{item.status == '驳回' ? item.memo : ''}}</span></uni-td>
      		<uni-td>{{item.price}}</uni-td>
          <uni-td>{{item.addtime }}</uni-td>
      	</uni-tr>
      </uni-table>
    </scroll-view>
  </view>
</template>

<script>
  export default{
    onShow() {
      this.getlist()
    },
    data() {
      return{
        scrollTop:0,
        jllist:[]
      }
    },
    methods:{
      getlist() {
        uni.request({
        	url: getApp().globalData.apiDomain+'wallet/withdrawList',
        	method: 'POST',
        	header: {
        		'content-type': 'application/x-www-form-urlencoded', //自定义请求头信息
        		'token': uni.getStorageSync('wbyun_token'),
            'wbapp':'weixin_mp_xbgy'
        	},
        	data: {
            
          },
        	dataType: 'json',
        	success:  res => {
            console.log(res);
        		if (res['data']['code'] == 200) {
               this.jllist = res.data.datas
               if(this.jllist == undefined) return
               this.jllist.map(item => {
                 Object.assign(item,{color:''})
                 if(item.status == 0) {
                     item.status = '审核中'
                   }else if(item.status == 1) {
                     item.color = 'green'
                     item.status = '已提现'
                   }else if(item.status == 2) {
                     item.status = '驳回'
                     item.color = 'red'
                   }
               })
        			return;   
        		} else { 
        			uni.showToast({
        				title: res['data']['msg'],
        				icon: 'none'
        			});
        		}
        	},
        	fail: () => {},
        	complete: () => {
        	}
        });
      }
    }
  }
  
</script>

<style>

</style>